-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix the exif_read_data issue #36420
fix the exif_read_data issue #36420
Conversation
d9c5383
to
5b4f201
Compare
5b4f201
to
3fb06ba
Compare
Signed-off-by: Simon L <[email protected]>
3fb06ba
to
a704619
Compare
@@ -56,10 +56,10 @@ public function execute(File $file): array { | |||
// But I don't understand why 1 as a special meaning. | |||
// Revert right after reading the exif data. | |||
$oldBufferSize = stream_set_chunk_size($fileDescriptor, 1); | |||
$data = exif_read_data($fileDescriptor, 'ANY_TAG', true); | |||
$data = @exif_read_data($fileDescriptor, 'ANY_TAG', true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was actually the only way how I could suppress the log message when testing with https://user-images.githubusercontent.com/12234510/205661916-3e7b14b4-6d4b-4dc2-9903-5265f95a2aee.png
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
/backport to stable25 |
What I find odd is that this seems to be only triggered by Android client uploads, but not when adding the exact same file via web interface. In one case, the error is thrown, in the other case EXIF data is retrieved just fine - so I guess there is still something else going on. Nevertheless, suppressing this error seems to make sense to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you understand why the try/catch is not enough ?
Not a fan of silencing error like that.
Maybe changing } catch (\Exception $ex) {
for } catch (\Throwable $ex) {
and changing log level to info would be enough ?
https://www.php.net/manual/function.exif-read-data.php states:
You cannot try/catch those errors, that goes straight to log. |
Thanks @come-nc! So good to merge? |
Fix #34958